package services

import "ShopSupplierApi/models"

//ConditionDiscountService 优惠活动操作服务层
type ConditionDiscountService struct{}

//ConDisServ 快递操作服务对象
var ConDisServ *ConditionDiscountService

func init() {
	ConDisServ = &ConditionDiscountService{}
}

//ProductList 货品列表
//param supplierID  uint64 供应商ID
//param p *Page 数据分页信息
func (*ConditionDiscountService) ProductList(supplierID uint64, p *models.Page) []map[string]interface{} {
    return models.ConDis.ProductList(supplierID,p)
}

//CatList 商品分类列表
//param p *Page 数据分页信息
func CatList(p *models.Page) []map[string]interface{} {
    return models.CatList(p)
}

//DiscountOrConditionList 获取优惠或条件列表
//param supplierID uint64 供应商ID
//param isCondition bool 是否是条件
//param p *Page 数据分页信息
func (*ConditionDiscountService) DiscountOrConditionList(supplierID uint64, isCondition bool, p *models.Page) []map[string]interface{} {
    return models.ConDis.DiscountOrConditionList(supplierID,isCondition,p)
}

//ConditionDiscountList 优惠活动列表
//param supplierID uint64 供应商ID
//param p *Page 数据分页信息
func (*ConditionDiscountService) ConditionDiscountList(supplierID uint64, p *models.Page) []map[string]interface{} {
    return models.ConDis.ConditionDiscountList(supplierID,p)
}

//AddDiscount 添加优惠信息
//param discount models.Discount 优惠信息
func (*ConditionDiscountService) AddDiscount(discount models.Discount) bool {
    return models.ConDis.AddDiscount(discount)
}

//AddCondition 添加优惠条件
//param condition models.Condition 优惠数据
func (*ConditionDiscountService) AddCondition(condition models.Condition) bool {
    return models.ConDis.AddCondition(condition)
}

//AddConditionDiscout 添加优惠活动
//param cd models.ConditionDiscount 优惠活动数据
func (*ConditionDiscountService) AddConditionDiscout(cd models.ConditionDiscount) bool{
    return models.ConDis.AddConditionDiscout(cd)
}